package com.coder4j.platform.controller;

import com.coder4j.starter.tools.util.StringUtils;
import com.coder4j.starter.tools.vo.R;
import com.coder4j.starter.web.BaseController;
import com.coder4j.platform.entity.SysContentEntity;
import com.coder4j.platform.mapper.SysContentMapper;
import com.coder4j.platform.service.SysContentService;
import com.coder4j.platform.vo.SysContentQuery;
import com.coder4j.platform.vo.SysContentVO;
import com.coder4j.platform.vo.SysContentEO;
import com.coder4j.starter.web.api.ApiNote;
import org.springframework.web.bind.annotation.*;

import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;

/**
 * 内容表，笔记、文章、教程等
 * @author keller
 * @date 2025-05-31 19:08:27
 */
@Slf4j
@RestController
@RequestMapping("/sysContent")
public class SysContentController extends BaseController<SysContentEntity,SysContentVO,SysContentEO,SysContentQuery, SysContentMapper,SysContentService> {
    @Resource
    private SysContentService service;

    @ApiNote(name = "按类型查询内容列表",createTime = "2025-06-03 11:31:05",createName = "keller")
    @GetMapping("/queryListByType")
    public R queryListByType(String type){
        if(StringUtils.isEmpty(type)){
            return R.paramError();
        }
        return R.success(service.queryListByType(type));
    }
}